package com.demo.spring;


public class Game {
    public class Equip {
        /**
         * 装备名称
         */
        private String name;

        /**
         * 装备类型，头盔、铠甲等
         */
        private String type;

        /**
         * 速度增效
         */
        private Long speedPlus;

        /**
         * 攻击增效
         */
        private Long attackPlus;

    public class Player {
        /**
         * 头盔
         */
        private Equip armet;
        /**
         * 铠甲
         */
        private Equip loricae;
        /**
         * 靴子
         */
        private Equip boot;
        /**
         * 指环
         */
        private Equip ring;

        public void updateEquip(Equip equip){
            if ("头盔".equals((equip.getType()))){
                System.out.println(armet.getName() + "升级为" + equip.getName());
                this.armet = equip;
            }

            if ("铠甲".equals((equip.getType()))){
                System.out.println(armet.getName() + "升级为" + equip.getName());
                this.loricae = equip;
            }

            if ("靴子".equals((equip.getType()))){
                System.out.println(armet.getName() + "升级为" + equip.getName());
                this.boot = equip;
            }

            if ("指环".equals((equip.getType()))){
                System.out.println(armet.getName() + "升级为" + equip.getName());
                this.ring = equip;
            }
        }

        public void print(){
            System.out.println("玩家头盔:" + this.getArmet() + "速度增效" + Equip.this.getSpeedPlus() );
        }

        public Equip getArmet() {
            return armet;
        }

        public void setArmet(Equip armet) {
            this.armet = armet;
        }

        public Equip getLoricae() {
            return loricae;
        }

        public void setLoricae(Equip loricae) {
            this.loricae = loricae;
        }

        public Equip getBoot() {
            return boot;
        }

        public void setBoot(Equip boot) {
            this.boot = boot;
        }

        public Equip getRing() {
            return ring;
        }

        public void setRing(Equip ring) {
            this.ring = ring;
        }
    }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public Long getSpeedPlus() {
            return speedPlus;
        }

        public void setSpeedPlus(Long speedPlus) {
            this.speedPlus = speedPlus;
        }

        public Long getAttackPlus() {
            return attackPlus;
        }

        public void setAttackPlus(Long attackPlus) {
            this.attackPlus = attackPlus;
        }
    }

}
